<template>
    <el-button class="previous" type="primary" size="mini" icon="el-icon-back" @click="previous"></el-button>
</template>

<script>
import { showAuthor } from "../../js/methods"
import { showNewMap } from "../../js/map"
import { showWaypoint } from "../../js/waypoint"
import { showTrajectoryAdd } from "../../js/trajectory"
export default {
    name: 'previous',
    components:{
        
    },
    data(){
        return{
           name: ""
        }
    },
    props:["param"],
    mounted(){
        
    },

    methods:{
        previous:function(){
            const that = this;
            that.$store.commit('switchAutherModule',false);
            that.$store.commit("switchEditMapBtns", false);
            that.$store.commit('switchAddStation', false);
            that.$store.commit('switchAddTrack', false);
            let params = that.param;
            if(params == "map"){
                showAuthor(true);
            }else if(params == "waypoint"){
                showNewMap(true);
            }else if(params == "trajectory"){
                showWaypoint(true);
            }else if(params == "end"){
                showTrajectoryAdd(true);
            }
        }
    },

    //属性监听
    watch:{
       
    }

}
</script>

<style scoped lang="less">
 .previous{
     position: absolute;
     top: 20px;
     left: 20px;
 }
</style>